@@ -4,19 +4,9 @@ module TumblrConcern |
||
| 4 | 4 |
included do |
| 5 | 5 |
include Oauthable |
| 6 | 6 |
|
| 7 |
- validate :validate_tumblr_options |
|
| 8 | 7 |
valid_oauth_providers :tumblr |
| 9 | 8 |
end |
| 10 | 9 |
|
| 11 |
- def validate_tumblr_options |
|
| 12 |
- unless tumblr_consumer_key.present? && |
|
| 13 |
- tumblr_consumer_secret.present? && |
|
| 14 |
- tumblr_oauth_token.present? && |
|
| 15 |
- tumblr_oauth_token_secret.present? |
|
| 16 |
- errors.add(:base, "Tumblr consumer_key, consumer_secret, oauth_token, and oauth_token_secret are required to authenticate with the Tumblr API. You can provide these as options to this Agent, or as Credentials with the same names, but starting with 'tumblr_'.") |
|
| 17 |
- end |
|
| 18 |
- end |
|
| 19 |
- |
|
| 20 | 10 |
def tumblr_consumer_key |
| 21 | 11 |
ENV['TUMBLR_OAUTH_KEY'] |
| 22 | 12 |
end |